-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add documentation for Function type #21649
Conversation
Wonderful, thanks for the doc improvements! |
Not a problem, its been a good way to get started understanding the contribution process. |
base/docs/basedocs.jl
Outdated
and anonymous functions. | ||
|
||
```jldoctest | ||
julia> typeof(+) <: Function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
write as isa(+, Function)
base/docs/basedocs.jl
Outdated
julia> typeof(+) <: Function | ||
true | ||
|
||
julia> typeof(x -> x + sin(x)) <: Function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
write as isa
base/docs/basedocs.jl
Outdated
julia> typeof(x -> x + sin(x)) <: Function | ||
true | ||
|
||
julia> typeof(cat) <: Function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isa
base/docs/basedocs.jl
Outdated
""" | ||
Function | ||
|
||
Abstract type for which all functions are a subtype. This includes operators, functions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More accurate would be "for which all functions are instances".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks!
base/docs/basedocs.jl
Outdated
""" | ||
Function | ||
|
||
Abstract type for which all functions are instances. This includes operators, functions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Abstract type for which every function, operator, and lambda is a concrete subtype."? Or is that too dense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about just "Abstract type of all functions?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Abstract type of all functions" seems reasonable on this end? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, "Abstract type of all functions" seems pretty clear to me too. @ararslan perhaps the examples can be changed to make it clear that functions have their own type and are always a subtype of Function
. I think we can rely on the rest of the documentation to make it clear that operators, lambdas and functions are all just functions in Julia.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @nsmith5! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Nice work here!
@TotalVerb how does this last revision look to you? Also, I'll squash my commits for brevity... |
FYI, there's no need for you to do so yourself, as GitHub now has the option to squash PR commits on merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks!
@ararslan Oh, thanks for the heads up. Do I select that when I make the pull request or does who ever performs the merge do that for me? Also, can you update the Docathon project? I'm keen to fill up the "Boom, done" category :) |
The one who performs the merge selects "Squash and merge" from a dropdown.
Absolutely! Done. Thanks again! |
Does this also need to be fixed on 0.5? |
I just tried it in 0.5 and it's still sitting here hanging... so I think so, yes. |
docsystem is different there so will need to refresh my memory on how to get it into the stdlib docs |
How does the backport process work? branch from release-0.5 and submit pull request there? |
(cherry picked from commit 0be9996)
Addresses the unwieldy auto-generated documentation noted in #20904.
Fixes #20904